home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Auge 4000 / Auge 4000 #51 (1990-12-01)(Amiga User Gruppe Einzugsgebiet 4000).zip / Auge 4000 #51 (1990-12-01)(Amiga User Gruppe Einzugsgebiet 4000).adf / Msh / doc / dev.man < prev    next >
Text File  |  1990-12-01  |  10KB  |  265 lines

  1.  
  2.      messydisk.device()    Amiga Programmer's Manual     messydisk.device()
  3.  
  4.  
  5.  
  6.      ›1mSYNOPSYS 
  7.           ›0m#include <exec/io.h>
  8.           #include <devices/trackdisk.h>
  9.           #include <dev.h>
  10.  
  11.           OpenDevice("messydisk.device", Unit, IOExtTD, Flags);
  12.           BeginIO(IOExtTD);
  13.           CloseDevice(IOExtTD);
  14.  
  15.      ›1mUSAGE 
  16.           ›0mMessydisk.device  can  be  used instead of trackdisk.device.
  17.           All current trackdisk.device commands are  supported.    The
  18.           only  functional difference is the format of the disk, which
  19.           is compatible with messydos systems.  
  20.  
  21.      ›1mCOMMANDS 
  22.           ›0mSupported commands are: 
  23.  
  24.           = CMD_INVALID     = CMD_RESET       * CMD_READ
  25.           * CMD_WRITE       * CMD_UPDATE      = CMD_CLEAR
  26.           = CMD_STOP        = CMD_START       = CMD_FLUSH
  27.             TD_MOTOR        = TD_SEEK         * TD_FORMAT
  28.             TD_REMOVE         TD_CHANGENUM      TD_CHANGESTATE
  29.             TD_PROTSTATUS     TD_RAWREAD        TD_RAWWRITE
  30.             TD_GETDRIVETYPE   TD_GETNUMTRACKS = TD_ADDCHANGEINT
  31.           = TD_REMCHANGEINT * ETD_WRITE       * ETD_READ
  32.             ETD_MOTOR       = ETD_SEEK        * ETD_FORMAT
  33.           * ETD_UPDATE      = ETD_CLEAR         ETD_RAWREAD
  34.             ETD_RAWWRITE
  35.  
  36.           The commands marked with * are handled in its own format  by
  37.           messydisk.   The  commands  marked  with  =  are  handled by
  38.           messydisk in the same way as trackdisk supposed  is  to  do.
  39.           The  other  commands  are sent straight through to trackdisk
  40.           and are subject to all its flaws and features.  
  41.  
  42.      ›1mOPENDEVICE FLAGS 
  43.           ›0mTDF_ALLOW_NON_3_5: Allows opening 40 track drives.  Ignored,
  44.           since it is the default behaviour which cannot be disabled.  
  45.  
  46.      ›1mIO REQUEST FLAGS 
  47.           ›0mThe io_Flags field of an IOStdReq or IOExtTD  structure  may
  48.           contain the following flags: 
  49.  
  50.           IOF_QUICK: This flag is supported for only a few commands.  
  51.  
  52.           IOTDF_INDEXSYNC: For ETD/CMD_RAWREAD and _WRITE.  
  53.  
  54.           IOMDF_40TRACKS:  This  flag  is  for  ETD/CMD_READ,  _WRITE,
  55.           _FORMAT, and _SEEK.  If set, treat the disk as  40  cylinder
  56.           media.   If  it happens to be in an 80 cylinder drive, every
  57.           other cylinder will be skipped to use the same  cylinders  a
  58.           40-cylinder drive  would.    Normally  you set or clear this
  59.           flag once at the time you read the bootblock and examine its
  60.           layout information.  It is guaranteed that  messydisk  won't
  61.           change this  flag.    IOMDF_40TRACKS  is  not  supported for
  62.           ETD/TD_RAWREAD and _RAWWRITE, since these are considered  to
  63.  
  64.  
  65.      KosmoSoft                        -1-                      Version 34.5
  66.  
  67.  
  68.      messydisk.device()    Amiga Programmer's Manual     messydisk.device()
  69.  
  70.  
  71.           be  "diagnostic" functions and therefore should be as raw as
  72.           possible.  
  73.  
  74.      ›1mDISK FORMAT 
  75.           ›0mThe disk format used is compatible  with  messydos  systems.
  76.           Both 40  and  80  cylinder  media  are supported.  There are
  77.           normally 9 sectors per track and two  tracks  per  cylinder.
  78.           (Outdated)  single-sided  disks  can  only  be  read  if the
  79.           driving  software  is  prepared  to  treat  them  as  normal
  80.           double-sided disks, and skip the sides that are not actually
  81.           present.  On the other hand, the number of sectors per track
  82.           may vary from 8 to 10. If the number of sectors is different
  83.           from  the  default value (9), then track 0 on side 0 must be
  84.           read first before this is recognized.  It  is  then  assumed
  85.           that  all  tracks on the entire disk have the same number of
  86.           sectors.  So, all position calculations  are  based  on  the
  87.           layout of the very first track.  
  88.  
  89.           --- Index pulse  ------------------------------------.
  90.                                                                |
  91.               60 * $4e    GAP 1   ($9254 encoded)              |
  92.                                                                |
  93.           --- First Sector -----------------------------.      |
  94.                                                         |      |
  95.               12 * $00    GAP 2   ($AAAA encoded)       |      |
  96.            |   3 * $a1    SYNC    ($4489 encoded)       |      |
  97.            |                                            |      |
  98.            |   1 * $fe    ID-Address Mark   -. ($5554)  |      |
  99.            |  track                          |          |      |
  100.            |  side                           |          |      |
  101.            |  sector                          > ID      |      |
  102.            |  length (0=128,1=256,2=512 etc.)|  Field   |  S   |
  103.            -> CRC 1                          |          |  e   |  T
  104.            -> CRC 2                         -'          |  c   |  r
  105.                                                          > t    > a
  106.               22 * $4e    GAP 1   ($9254 encoded)       |  o   |  c
  107.               12 * $00    GAP 2   ($AAAA encoded)       |  r   |  k
  108.            |   3 * $a1    SYNC    ($4489 encoded)       |      |
  109.            |                                            |      |
  110.            |   1 * $fb    DATA-Adress Mark  -. ($5545)  |      |
  111.            |  512 bytes data                  > DATA    |      |
  112.            -> CRC 1                          |  Field   |      |
  113.            -> CRC 2                         -'          |      |
  114.                                                         |      |
  115.                                                         |      |
  116.               80 * $4e    GAP 3   ($9254 encoded)       |      |
  117.           ----------------------------------------------'      |
  118.                                                                |
  119.            ...... 8 more sectors .......                       |
  120.                                                                |
  121.               rest  $4e           ($9254 encoded)              |
  122.           -----------------------------------------------------'
  123.  
  124.      ›1mDEVIATIONS 
  125.           ›0mThe TD_REMCHANGEINT command works.  (It doesn't with the 1.2
  126.           or 1.3 trackdisk.device).  
  127.  
  128.  
  129.  
  130.  
  131.      KosmoSoft                        -2-                      Version 34.5
  132.  
  133.  
  134.      messydisk.device()    Amiga Programmer's Manual     messydisk.device()
  135.  
  136.  
  137.           The   messydisk   Unit   structure   does   not   look  like
  138.           TDU_PublicUnit at all.  
  139.  
  140.           In some situations, error returns may be different  or  less
  141.           specific.  
  142.  
  143.           Data  buffers  to be read or written currently don't need to
  144.           be in Chip memory.  This might change in the  future.    For
  145.           future  compatibility  and  with  the  trackdisk.device  you
  146.           should not depend on this.  
  147.  
  148.           In order to be able to format a  track  with  a  nonstandard
  149.           number of sectors (from 8 to 10), you must use the TD_FORMAT
  150.           command  with  less than 40 sectors (20480 bytes) at a time.
  151.           Since you must always format entire tracks at a  time,  this
  152.           uniquely  determines  the number of sectors you want on each
  153.           track.  The current number of sectors per track, which  will
  154.           be  used  later  when reading from the same disk, is updated
  155.           accordingly.   If  you   specify   40   sectors   or   more,
  156.           messydisk.device does not attempt to guess what you want but
  157.           simply uses  the  value  that  was already set.  So, you may
  158.           choose to first  format  a  single  track  to  indicate  the
  159.           desired  number  of  sectors per track, and then in one call
  160.           format the entire rest of the disk.  
  161.  
  162.           When a disk with more or less than 9 sectors  per  track  is
  163.           read,  you must first issue a CMD_READ command for the first
  164.           sector(s) of  the   disk.      When   track   0   is   read,
  165.           messydisk.device  determines how many sectors there are on a
  166.           track.  This number is then used afterwards when calculating
  167.           the tracks and sides of other sectors.   So,  this  is  very
  168.           important.  But for those (virtually impossible) cases where
  169.           not  all tracks have the same number of sectors, all sectors
  170.           that  were  read  on  any  track  will  be   written   back.
  171.           Fortunately,   all  currently  known  file  systems  have  a
  172.           bootblock  at  track  0,  side  0,   so   they   all   adapt
  173.           transparently.  
  174.  
  175.      ›1mCAVEATS 
  176.           ›0mThe (outdated) TD_REMOVE command is routed to trackdisk.  As
  177.           a  result of this, only one disk remove interrupt (per unit)
  178.           may  be  installed  (with  this  command),  whether  through
  179.           trackdisk or  messydisk.    (This  seems  to  have  been the
  180.           original  intention  of  TD_REMOVE.)  Of   course,   current
  181.           programs should use TD_ADDCHANGEINT.  
  182.  
  183.      ›1mUTILITIES 
  184.           ›0mA  separate  program  called  Ignore  is supplied, which may
  185.           suppress the CRC check in any currently open unit.  When the
  186.           unit is definitively closed and later reopened, ignoring CRC
  187.           mismatches again has its default value of No.  
  188.  
  189.           Usage: ignore <unitnr> <YES/NO>
  190.  
  191.           If you only give the unit number, ignore will output  either
  192.           Yes  or  No, reflecting whether CRC mismatches currently are
  193.           ignored.  
  194.  
  195.  
  196.  
  197.      KosmoSoft                        -3-                      Version 34.5
  198.  
  199.  
  200.      messydisk.device()    Amiga Programmer's Manual     messydisk.device()
  201.  
  202.  
  203.           This program can be useful when you  wish  to  recover  data
  204.           from a  damaged  or marginal disk.  Sometimes text files may
  205.           be usable even if there are a few errors in them.  
  206.  
  207.      ›1mAUTHORS 
  208.           ›0mMessydisk is written by ›3mSourcerer ›0mOlaf ›3mRhialto ›0mSeibert.  The
  209.           low-level   writing  part  was  originally  done  by  Werner
  210.           Günther. Used with permission.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.      KosmoSoft                        -4-                      Version 34.5
  264.  
  265.